import {BaseController} from 'egg-cool-controller';
import router from 'egg-cool-router';

/**
 * 应用通用控制器
 */
@router.prefix ('/wx/product' , ['add' , 'update' , 'info'])
export default class WxProductController extends BaseController {
    init () {
        this.setEntity (this.ctx.repo.goods.Product);
        this.setService (this.service.goods.product);
    }

    /**
     * 详情
     */
    @router.get ('/info')
    public async info () {
        const {id} = this.getQuery ();
        this.res ({data : await this.service.goods.product.info (id , this.ctx.repo.goods.Product)});
    }

    /**
     * 添加
     */
    // @router.get('/add')
    // public async add () {
    //     const {id} = this.getQuery()
    //     this.res({ data: await this.service.goods.product.add(id,this.ctx.repo.goods.Product) });
    // }
}
